-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add {{target}} substitution to compiletest #126256
Conversation
rustbot has assigned @albertlarsan68. Use |
Some changes occurred in src/tools/compiletest cc @jieyouxu |
let v = v.trim_start_matches(|c| c == ' ' || c == '='); | ||
let v = if v == "{{target}}" { Some((v, v)) } else { v.split_once("-") }; | ||
if let Some((arch, _)) = v { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just puts {{target}}
into arch
, probably not ideal but currently the arch string is not used anyways so it's unclear what would be the best thing to do here for now until things do get validated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you consider adding a new field to RevisionInfo
? Since target_arch
is an Option
, we can leave it as None
for {{target}}
values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The compiletest changes look reasonable to me. The tidy change I'll leave up to T-bootstrap to decide.
@bors r+ |
Can you please update the substitutions documentation at https://rustc-dev-guide.rust-lang.org/tests/headers.html#substitutions? |
…tlarsan68 Add {{target}} substitution to compiletest In ferrocene we have ui tests testing the cli interface of the compiler, one of which tests the `--target` flag. To be able to run this on all targets we require a way to specify a valid target in the `compile-flags` directive that is target independent, as otherwise we can only run the test against the one target we choose to supply in the flags. See https://github.com/ferrocene/ferrocene/blob/383cbc80f4e85859a4055f121f15dac329908346/tests/ui/ferrocene/compiler-arguments/target/target.rs We figured the project might be able to make use of this substitution as well in the future.
Rollup of 7 pull requests Successful merges: - rust-lang#115974 (Split core's PanicInfo and std's PanicInfo) - rust-lang#125659 (Remove usage of `isize` in example) - rust-lang#125669 (CI: Update riscv64gc-linux job to Ubuntu 22.04, rename to riscv64gc-gnu) - rust-lang#125684 (Account for existing bindings when suggesting `pin!()`) - rust-lang#126055 (Expand list of trait implementers in E0277 when calling rustc with --verbose) - rust-lang#126174 (Migrate `tests/run-make/prefer-dylib` to `rmake.rs`) - rust-lang#126256 (Add {{target}} substitution to compiletest) r? `@ghost` `@rustbot` modify labels: rollup
…tlarsan68 Add {{target}} substitution to compiletest In ferrocene we have ui tests testing the cli interface of the compiler, one of which tests the `--target` flag. To be able to run this on all targets we require a way to specify a valid target in the `compile-flags` directive that is target independent, as otherwise we can only run the test against the one target we choose to supply in the flags. See https://github.com/ferrocene/ferrocene/blob/383cbc80f4e85859a4055f121f15dac329908346/tests/ui/ferrocene/compiler-arguments/target/target.rs We figured the project might be able to make use of this substitution as well in the future.
@bors r- (suspected to have caused #126277 (comment)) |
I am suspecting this might need to update a codegen test (#126277 (comment) failed and I'm trying to find out which PR caused the failure and this one seems most likely), but I cannot say for certain. So, let's @bors try |
Add {{target}} substitution to compiletest In ferrocene we have ui tests testing the cli interface of the compiler, one of which tests the `--target` flag. To be able to run this on all targets we require a way to specify a valid target in the `compile-flags` directive that is target independent, as otherwise we can only run the test against the one target we choose to supply in the flags. See https://github.com/ferrocene/ferrocene/blob/383cbc80f4e85859a4055f121f15dac329908346/tests/ui/ferrocene/compiler-arguments/target/target.rs We figured the project might be able to make use of this substitution as well in the future. try-job: dist-x86_64-msvc
☀️ Try build successful - checks-actions |
... then it was not this PR. @bors r=@albertlarsan68 rollup |
…tlarsan68 Add {{target}} substitution to compiletest In ferrocene we have ui tests testing the cli interface of the compiler, one of which tests the `--target` flag. To be able to run this on all targets we require a way to specify a valid target in the `compile-flags` directive that is target independent, as otherwise we can only run the test against the one target we choose to supply in the flags. See https://github.com/ferrocene/ferrocene/blob/383cbc80f4e85859a4055f121f15dac329908346/tests/ui/ferrocene/compiler-arguments/target/target.rs We figured the project might be able to make use of this substitution as well in the future. try-job: dist-x86_64-msvc
Rollup of 6 pull requests Successful merges: - rust-lang#123374 (DOC: Add FFI example for slice::from_raw_parts()) - rust-lang#126127 (Spell out other trait diagnostic) - rust-lang#126228 (Provide correct parent for nested anon const) - rust-lang#126249 (Simplify `[T; N]::try_map` signature) - rust-lang#126256 (Add {{target}} substitution to compiletest) - rust-lang#126263 (Make issue-122805.rs big endian compatible) r? `@ghost` `@rustbot` modify labels: rollup
…tlarsan68 Add {{target}} substitution to compiletest In ferrocene we have ui tests testing the cli interface of the compiler, one of which tests the `--target` flag. To be able to run this on all targets we require a way to specify a valid target in the `compile-flags` directive that is target independent, as otherwise we can only run the test against the one target we choose to supply in the flags. See https://github.com/ferrocene/ferrocene/blob/383cbc80f4e85859a4055f121f15dac329908346/tests/ui/ferrocene/compiler-arguments/target/target.rs We figured the project might be able to make use of this substitution as well in the future. try-job: dist-x86_64-msvc
…kingjubilee Rollup of 8 pull requests Successful merges: - rust-lang#123374 (DOC: Add FFI example for slice::from_raw_parts()) - rust-lang#126210 (docs(core): make more const_ptr doctests assert instead of printing) - rust-lang#126228 (Provide correct parent for nested anon const) - rust-lang#126242 (Simplify provider api to improve llvm ir) - rust-lang#126249 (Simplify `[T; N]::try_map` signature) - rust-lang#126256 (Add {{target}} substitution to compiletest) - rust-lang#126263 (Make issue-122805.rs big endian compatible) - rust-lang#126286 (Make `storage-live.rs` robust against rustc internal changes.) r? `@ghost` `@rustbot` modify labels: rollup
…tlarsan68 Add {{target}} substitution to compiletest In ferrocene we have ui tests testing the cli interface of the compiler, one of which tests the `--target` flag. To be able to run this on all targets we require a way to specify a valid target in the `compile-flags` directive that is target independent, as otherwise we can only run the test against the one target we choose to supply in the flags. See https://github.com/ferrocene/ferrocene/blob/383cbc80f4e85859a4055f121f15dac329908346/tests/ui/ferrocene/compiler-arguments/target/target.rs We figured the project might be able to make use of this substitution as well in the future. try-job: dist-x86_64-msvc
…kingjubilee Rollup of 16 pull requests Successful merges: - rust-lang#123374 (DOC: Add FFI example for slice::from_raw_parts()) - rust-lang#124514 (Recommend to never display zero disambiguators when demangling v0 symbols) - rust-lang#125978 (Cleanup: HIR ty lowering: Consolidate the places that do assoc item probing & access checking) - rust-lang#125980 (Nvptx remove direct passmode) - rust-lang#126187 (For E0277 suggest adding `Result` return type for function when using QuestionMark `?` in the body.) - rust-lang#126210 (docs(core): make more const_ptr doctests assert instead of printing) - rust-lang#126249 (Simplify `[T; N]::try_map` signature) - rust-lang#126256 (Add {{target}} substitution to compiletest) - rust-lang#126263 (Make issue-122805.rs big endian compatible) - rust-lang#126281 (set_env: State the conclusion upfront) - rust-lang#126286 (Make `storage-live.rs` robust against rustc internal changes.) - rust-lang#126287 (Update a cranelift patch file for formatting changes.) - rust-lang#126301 (Use `tidy` to sort crate attributes for all compiler crates.) - rust-lang#126305 (Make PathBuf less Ok with adding UTF-16 then `into_string`) - rust-lang#126310 (Migrate run make prefer rlib) - rust-lang#126314 (fix RELEASES: we do not support upcasting to auto traits) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#126256 - ferrocene:lw-target-subst, r=albertlarsan68 Add {{target}} substitution to compiletest In ferrocene we have ui tests testing the cli interface of the compiler, one of which tests the `--target` flag. To be able to run this on all targets we require a way to specify a valid target in the `compile-flags` directive that is target independent, as otherwise we can only run the test against the one target we choose to supply in the flags. See https://github.com/ferrocene/ferrocene/blob/383cbc80f4e85859a4055f121f15dac329908346/tests/ui/ferrocene/compiler-arguments/target/target.rs We figured the project might be able to make use of this substitution as well in the future. try-job: dist-x86_64-msvc
…kingjubilee Rollup of 16 pull requests Successful merges: - rust-lang#123374 (DOC: Add FFI example for slice::from_raw_parts()) - rust-lang#124514 (Recommend to never display zero disambiguators when demangling v0 symbols) - rust-lang#125978 (Cleanup: HIR ty lowering: Consolidate the places that do assoc item probing & access checking) - rust-lang#125980 (Nvptx remove direct passmode) - rust-lang#126187 (For E0277 suggest adding `Result` return type for function when using QuestionMark `?` in the body.) - rust-lang#126210 (docs(core): make more const_ptr doctests assert instead of printing) - rust-lang#126249 (Simplify `[T; N]::try_map` signature) - rust-lang#126256 (Add {{target}} substitution to compiletest) - rust-lang#126263 (Make issue-122805.rs big endian compatible) - rust-lang#126281 (set_env: State the conclusion upfront) - rust-lang#126286 (Make `storage-live.rs` robust against rustc internal changes.) - rust-lang#126287 (Update a cranelift patch file for formatting changes.) - rust-lang#126301 (Use `tidy` to sort crate attributes for all compiler crates.) - rust-lang#126305 (Make PathBuf less Ok with adding UTF-16 then `into_string`) - rust-lang#126310 (Migrate run make prefer rlib) - rust-lang#126314 (fix RELEASES: we do not support upcasting to auto traits) r? `@ghost` `@rustbot` modify labels: rollup
In ferrocene we have ui tests testing the cli interface of the compiler, one of which tests the
--target
flag. To be able to run this on all targets we require a way to specify a valid target in thecompile-flags
directive that is target independent, as otherwise we can only run the test against the one target we choose to supply in the flags. See https://github.com/ferrocene/ferrocene/blob/383cbc80f4e85859a4055f121f15dac329908346/tests/ui/ferrocene/compiler-arguments/target/target.rsWe figured the project might be able to make use of this substitution as well in the future.
try-job: dist-x86_64-msvc